package com.sss.demo.service.impl;

import com.sss.demo.dao.IUser;
import com.sss.demo.dao.impl.IUserImpl;
import com.sss.demo.entity.User;
import com.sss.demo.service.UserService;

import java.sql.SQLException;



public class UserServiceImpl implements UserService {
    // 将数据层的接口声明进来
    IUser iUser;

    @Override
    public boolean login(User user) {
        iUser=new IUserImpl();
        try {
            return iUser.login(user);
        } catch (SQLException e) {
            e.printStackTrace();
        }
            return false;
    }

    @Override
    public boolean register(User user) {
        iUser=new IUserImpl();
        try {
            return iUser.register(user);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;
    }

    @Override
    public boolean selectOne(User user) {
        iUser=new IUserImpl();
        try {
           return iUser.selectOne(user);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;
    }

}
